const fs = require('fs-extra');
const path = require('path');

let sourceDir = path.join(__dirname, 'node_modules', 'lightweight-charts', "dist", "lightweight-charts.standalone.development.js");
let destDir = path.join(__dirname, 'pika_charts', 'js', 'lightweight-charts.js');
fs.copy(sourceDir, destDir, {recursive: true}, (err) => {
    if (err) return console.error(err);
    console.log('lightweight-charts.js copied successfully!');
});

sourceDir = path.join(__dirname, 'dist', 'bundle.js');
destDir = path.join(__dirname, 'pika_charts', 'js', 'bundle.js');
fs.copy(sourceDir, destDir, {recursive: true}, (err) => {
    if (err) return console.error(err);
    console.log('bundle.js copied successfully!');
});

sourceDir = path.join(__dirname, 'src', 'general', 'styles.css');
destDir = path.join(__dirname, 'pika_charts', 'js', 'styles.css');
fs.copy(sourceDir, destDir, {recursive: true}, (err) => {
    if (err) return console.error(err);
    console.log('styles.css copied successfully!');
});